# -*- coding: utf-8 -*-
"""
Created on Sun Apr 21 12:04:03 2019

@author: LENOVO
"""

with open('pi_digits.txt') as file_object:
    contents = file_object.read()
    print(contents.rstrip())
    
filename = 'pi_digits.txt'
with open(filename) as file_object:
    for line in file_object:
        print(line)
        
with open(filename) as file_object:
    lines = file_object.readlines()
    for line in lines:
        print(line.rstrip())